		include	Common.asm

; ==========================================================
Stack		segment para stack 'stack'
	dw	256 dup (0)
Stack		ends


; ==========================================================
DataSeg		segment para public 'data'


DataSeg		ends


; ==========================================================
CodeSeg		segment para public 'code'
		assume	ds: DataSeg

Main		proc	near

	mov	ax, DataSeg
	mov	ds, ax

	call	Randomize	

	mov	al, 13h		; al = 13h - 320x200x256
	call	SetGraphicMode

	mov	cx, 0
	mov	dx, GraphScreenWidth
	call	SetMouseHorzRange
	mov	cx, 0
	mov	dx, GraphScreenHeight
	call	SetMouseVertRange
	mov	cx, GraphScreenWidth
	shr	cx, 1
	mov	dx, GraphScreenHeight
	shr	dx, 1
	call	SetMousePos

	call	LoadResource

	mov	ax, offset MenuStageClass
	mov	NextStageClass, ax

	call 	InitUI
MainLoop:
	call	MainLoopProcedure

	cmp	Terminated, 0
	je	MainLoop

	call	SoundOff

	mov	al, 3h		; al = 3h - Text Mode
	call	SetGraphicMode

	mov	al, 0		; al = exit code
	call	ExitProgram

	ret

Main		endp

CodeSeg		ends

		end	Main

